//package com.yili.oa.controller;
//
//import com.yili.oa.utils.Exception.AjaxException;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import io.swagger.annotations.ApiParam;
//import org.apache.commons.lang3.StringUtils;
//import org.springframework.beans.BeanUtils;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.*;
//
//import java.util.ArrayList;
//import java.util.List;
//
///**
// * @author lxr
// * @version v0.01
// * @date 2019/8/17 0017
// * @email 200890949@qq.com
// */
//@Api("VUE接口")
//@RestController
//@RequestMapping("/vueApi")
//public class VueApi {
//
//    @Autowired
//    private FtVipService ftVipService;
//
//    @Autowired
//    private NoticeService noticeService;
//
//    @Autowired
//    private TurnoverService turnoverService;
//
//    @GetMapping("/getVip/{lv}")
//    @ApiOperation(value = "得到当前用户的vip等级")
//    public FtVipRes getVip(@ApiParam("用户等级") @PathVariable("lv")Integer lv){
//        return ftVipService.getByLv(lv);
//    }
//
//    @GetMapping("/getNotice/{type}")
//    @ApiOperation(value = "type:0浮动公告 1日常消息 2游戏帮助")
//    public List<NoticeRes> getNotice(@ApiParam("用户等级") @PathVariable("type")Integer type){
//
//        return noticeService.getByType(type);
//    }
//
//    @PostMapping("/addExchange")
//    @ApiOperation(value = "添加提现记录")
//    public UserExchangeRes addUserExchange(@ApiParam("提现记录") UserExchangeReq userExchange){
//        if (StringUtils.isBlank(userExchange.getUserId())){
//            throw new AjaxException("请输入用户id");
//        }
//        if (StringUtils.isBlank(userExchange.getBankAccount())){
//            throw new AjaxException("请输入银行账号");
//        }
//        if (StringUtils.isBlank(userExchange.getBank())){
//            throw new AjaxException("请输入银行账号");
//        }
//        if (StringUtils.isBlank(userExchange.getBankUser())){
//            throw new AjaxException("请输入持卡人");
//        }
//        if (userExchange.getExchangeNum()==null || userExchange.getExchangeNum()==0){
//            throw new AjaxException("请输入提现金额");
//        }
//        if (userExchange.getTime()==null || userExchange.getTime()==0){
//            throw new AjaxException("请输入时间");
//        }
//        UserExchange result = turnoverService.addExchange(userExchange);
//        if (result==null){
//            return null;
//        }
//        UserExchangeRes userExchangeRes = new UserExchangeRes();
//        BeanUtils.copyProperties(result,userExchangeRes);
//        return userExchangeRes;
//    }
//
//    @GetMapping("/getExchange/{userId}")
//    @ApiOperation(value = "获得用户的提现记录")
//    public List<UserExchangeRes> getExchange(@ApiParam("用户id") @PathVariable("userId")String userId){
//        List<UserExchange> list = turnoverService.getList(null,userId);
//        List<UserExchangeRes> result = new ArrayList<>();
//        for (UserExchange userExchange:
//             list) {
//            UserExchangeRes userExchangeRes = new UserExchangeRes();
//            BeanUtils.copyProperties(userExchange,userExchangeRes);
//            result.add(userExchangeRes);
//        }
//        return result;
//    }
//
//    @PostMapping("/addRecharge")
//    @ApiOperation(value = "添加充值记录")
//    public UserRechargeRes addUserRecharge(@ApiParam("充值记录") UserRechargeReq userRechargeReq){
//        if (StringUtils.isBlank(userRechargeReq.getUserId())){
//            throw new AjaxException("请输入用户id");
//        }
//        if (StringUtils.isBlank(userRechargeReq.getRechargeChannel())){
//            throw new AjaxException("请输入充值渠道");
//        }
//        if (StringUtils.isBlank(userRechargeReq.getRechargeType())){
//            throw new AjaxException("请输入充值方式");
//        }
//        if (userRechargeReq.getRechargeNum()==null || userRechargeReq.getRechargeNum()==0){
//            throw new AjaxException("请输入充值数量");
//        }
//        if (userRechargeReq.getTime()==null || userRechargeReq.getTime()==0){
//            throw new AjaxException("请输入时间");
//        }
//        UserRecharge result = turnoverService.addRecharge(userRechargeReq);
//        if (result==null){
//            return null;
//        }
//        UserRechargeRes userRechargeRes = new UserRechargeRes();
//        BeanUtils.copyProperties(result,userRechargeRes);
//        return userRechargeRes;
//    }
//
//    @GetMapping("/getRecharge/{userId}")
//    @ApiOperation(value = "获得用户的充值记录")
//    public List<UserRechargeRes> getRecharge(@ApiParam("用户id") @PathVariable("userId")String userId){
//        List<UserRecharge> list = turnoverService.getRechargeList(null,userId);
//        List<UserRechargeRes> result = new ArrayList<>();
//        for (UserRecharge userRecharge:
//                list) {
//            UserRechargeRes userRechargeRes = new UserRechargeRes();
//            BeanUtils.copyProperties(userRecharge,userRechargeRes);
//            result.add(userRechargeRes);
//        }
//        return result;
//    }
//
//
//
//
//}
